package polymorphsm1;

public class Test1
{
    public static void main(String[] args) {
        //目标：认识多态代码
        //1，对象多态，行为多态
        Animal a1 = new Wolf();
        Animal a2 = new Tortoise();
        a1.run();//方法编译看左边，运行看右边
        a2.run();//方法编译看左边，运行看右边
        System.out.println(a1.name);
        System.out.println(a2.name);//成员变量：编译看左边，运行看左边
    }
}
